package com.xunji.xunji.module.account.mvp.model.impl;

import com.huanxiao.base.net.HttpClient;
import com.huanxiao.base.net.RespResult;
import com.xunji.xunji.module.account.bean.TokenInfo;
import com.xunji.xunji.module.account.bean.UserInfo;
import com.xunji.xunji.module.account.mvp.model.IUserModel;
import com.xunji.xunji.net.APIService;

import java.util.Map;

import rx.Observable;

/**
 * Created by paul on 16/10/18.
 */

public class UserModel implements IUserModel {


    @Override
    public Observable<RespResult<TokenInfo>> tokenCreate(Map<String, String> param) {
        return HttpClient.getAPIService(APIService.class).tokenCreate(param);
    }

    /**
     * 发送验证码
     *
     * @param params
     * @return
     */
    @Override
    public Observable<RespResult> sendCode(Map<String, String> params) {
        return HttpClient.getAPIService(APIService.class).sendCode(params);
    }

    @Override
    public Observable<RespResult> sendForgetCode(Map<String, String> params) {
        return HttpClient.getAPIService(APIService.class).sendForgetCode(params);
    }

    /**
     * 登录
     *
     * @param params
     * @return
     */
    @Override
    public Observable<RespResult<String>> userLogin(Map<String, String> params) {
        return HttpClient.getAPIService(APIService.class).userLogin(params);
    }

    /**
     * 用户信息
     *
     * @param params
     * @return
     */
    @Override
    public Observable<RespResult<UserInfo>> userInfo(Map<String, String> params) {
        return HttpClient.getAPIService(APIService.class).userInfo(params);
    }

    /**
     * 退出登录
     *
     * @param params
     * @return
     */
    @Override
    public Observable<RespResult<Object>> loginOut(Map<String, String> params) {
        return HttpClient.getAPIService(APIService.class).loginOut(params);
    }

    @Override
    public Observable<RespResult<Object>> refreshHeadIcon(Map<String, String> params) {
        return HttpClient.getAPIService(APIService.class).refreshHeadIcon(params);
    }

    @Override
    public Observable<RespResult> register(Map<String, String> params) {
        return HttpClient.getAPIService(APIService.class).register(params);
    }

    @Override
    public Observable<RespResult> resetPswd(Map<String, String> params) {
        return HttpClient.getAPIService(APIService.class).resetPswd(params);
    }

    @Override
    public Observable<RespResult> changePswd(Map<String, String> params) {
        return HttpClient.getAPIService(APIService.class).changePswd(params);
    }

    @Override
    public Observable<RespResult> authCertification(Map<String, String> params) {
        return HttpClient.getAPIService(APIService.class).authCertification(params);
    }

    @Override
    public Observable<RespResult> authStatus(Map<String, String> params) {
        return HttpClient.getAPIService(APIService.class).authStatus(params);
    }

    @Override
    public Observable<RespResult> authVerifyPhone(Map<String, String> params) {
        return HttpClient.getAPIService(APIService.class).authVerifyPhone(params);
    }

    @Override
    public Observable<RespResult<TokenInfo>> thirdLogin(Map<String, String> params) {
        return HttpClient.getAPIService(APIService.class).thirdLogin(params);
    }

    @Override
    public Observable<RespResult<String>> getQiniuUpToken(Map<String, String> params) {
        return HttpClient.getAPIService(APIService.class).getQiniuUpToken(params);
    }


}
